How to: Create a Calculated control in a form.
Solution:
In the Form Design view, click 'Text Box' from the Toolbox. Type the expression either directly into the text box or using the Property sheet.
NOTE 1: The 'Developer Tools' must be installed during the installation set up.
NOTE 2: To create a Calculated Control, the form must be open in Design view.
1) If the Database window is not active, activate the Database window.
2) Click the 'Forms' tab in the Database window.
Forms tab
3) Select the desired form from the list box. (The selected form is highlighted.)
4) Click 'Design'. (The selected form appears in the Design view and the floating Toolbox appears.)
5) Make sure the 'Control Wizard' button located in the Toolbox is depressed.
Control Wizard and Text Box
6) Click the 'Text Box' button in the Toolbox.
7) Position the mouse button on the from to select the location for the text box.
8) Click the location for the check box on the form. (Both the label and the text box appear on the form.)
Label box and text box.
9) Do one of the following:
a) Click to select the text box and type the expression directly in the text box.
Type Expression
NOTE: The expression refers to at least one field from the table or query that the form is related to. When referring to the field, enclose the field name with brackets and begin the expression with the '=' operator.
Type Expression
b) Use the Property sheet to do the following:
1] Click to select the text box. (Handles appear around the box.)
Handles around text box
2] Select the 'View' menu and select 'Properties'. (The property sheet appears.)
3] Click the 'Data' tab.
Property sheet
4] Click in the 'Control Source' property box. (A down arrow appears.)
5] Select the down arrow. (A drop-down list appears.)
6] Select the field(s) to be used in the expression.
Data Tab and drop-down list
NOTE: Separate each field with an operator.
7] Build the expression using the desired operators in the 'Control Source' property box.
NOTE: Integers can be used as part of the expression.
EXAMPLE: =<[Unitprice]>*5
(where <[Unitprice]> is a field from the selected table or query that is to be multiplied by 5).
Control Source' property box
8] To close the property sheet, click the 'X' button in the upper-right hand corner of the property sheet.
Click the X button to close property sheet
NOTE: The properties will be saved only when the design view is saved.
10) To edit the label box, do the following:
a) Click to select the label box. (Handles appear around the box.)
b) Select the 'View' menu and select 'Properties'. (The property sheet appears.)
c) Click the 'Format' tab.
d) Type the name of the label box in the 'Caption' property box.
Editing the label box
e) To close the property sheet, click the 'X' button in the upper-right hand corner of the property sheet.
Click the X button to close property sheet
11) Select the 'File' from the menu and select 'Save' to save the form.